﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Data;

public partial class Main : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string user = Common.ReadCookie("user");
        if (user.Length > 0)
        {
            Panel1.Title = "<h1>eBay模板生成系统</h1>";
            Panel1.Html = "<h5>" + user + "</h5>";
            StringBuilder sb = new StringBuilder();
            sb.Append("OS Version:" + Environment.OSVersion.ToString() + "<br />");
            sb.Append("CPU:" + Environment.GetEnvironmentVariable("NUMBER_OF_PROCESSORS") + "<br />");// CPU个数：
            sb.Append("CpuType:" + Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER") + "<br />");// CPU类型：
            sb.Append("信息服务软件:" + Request.ServerVariables["SERVER_SOFTWARE"] + "<br />"); // 信息服务软件：
            sb.Append("服务器名:" + Server.MachineName + "<br />");// 服务器名
            sb.Append("虚拟服务绝对路径:" + Request.ServerVariables["APPL_PHYSICAL_PATH"] + "<br />");// 虚拟服务绝对路径
            sb.Append("NET Version:" + ".NET CLR " + Environment.Version.ToString() + "<br /><br />"); // DotNET 版本


            sb.Append("<p>");
            DataSet ds = SqliteHelper.ExecuteDataset(SqliteHelper.ConnectionString, CommandType.Text, "select * from TemFields");
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    sb.Append(ds.Tables[0].Rows[i]["fields"].ToString() + ds.Tables[0].Rows[i]["desc"].ToString() + ds.Tables[0].Rows[i]["fieldsName"].ToString() + "<br>");
                }
            }
            sb.Append("</p>");
            Panel5.Html = sb.ToString();
        }
        else {
            Response.Redirect("default.aspx");
        
        }
    }
}